<div>
  <span class="brand" style="font-weight:bold;">{{degradeRuleDialog.title}}</span>
  <div class="card" style="margin-top: 20px;margin-bottom: 10px;">
    <div class="panel-body">
      <div class="row">
        <form class="form-horizontal" role="form">
          <div class="form-group">
            <label class="col-sm-2 control-label">资源名</label>
            <div class="col-sm-9">
              <input class="form-control" disabled="" ng-if="degradeRuleDialog.type == 'edit'" ng-model='currentRule.resource'
                     placeholder="资源名"
                     type="text"/>
              <input class="form-control highlight-border" ng-if="degradeRuleDialog.type == 'add'" ng-model='currentRule.resource'
                     placeholder="资源名" type="text"
              />
            </div>
          </div>

          <!--<div class="form-group">-->
          <!--<label class="col-sm-2 control-label">流控应用</label>-->
          <!--<div class="col-sm-9">-->
          <!--<input type="text" class="form-control highlight-border" ng-model='currentRule.limitApp' placeholder='"default"表示所有应用。' />-->
          <!--</div>-->
          <!--</div>-->

          <div class="form-group">
            <label class="col-sm-2 control-label">降级策略</label>
            <div class="col-sm-9">
              <div align="center" class="form-control highlight-border">
                <input checked name="grade" ng-model='currentRule.grade' title="秒级平均响应时间" type="radio" value="0"/>&nbsp;RT&nbsp;&nbsp;
                <input name="grade" ng-model='currentRule.grade' title="秒级异常比例" type="radio" value="1"/>&nbsp;异常比例&nbsp;&nbsp;
                <input name="grade" ng-model='currentRule.grade' title="分钟级异常数，仅 1.3.0 及以上版本生效" type="radio" value="2"/>&nbsp;异常数
              </div>
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label" ng-if="currentRule.grade == 0">RT</label>
            <label class="col-sm-2 control-label" ng-if="currentRule.grade == 1">异常比例</label>
            <label class="col-sm-2 control-label" ng-if="currentRule.grade == 2">异常数</label>
            <div class="col-sm-3">
              <input class="form-control highlight-border" ng-if="currentRule.grade == 0" ng-model='currentRule.count'
                     placeholder="毫秒" type='number'/>
              <input class="form-control highlight-border" ng-if="currentRule.grade == 1" ng-model='currentRule.count'
                     placeholder="0.0~1.0" type='number'/>
              <input class="form-control highlight-border" ng-if="currentRule.grade == 2" ng-model='currentRule.count'
                     placeholder="异常数" type='number'/>
            </div>
            <label class="col-sm-2 control-label">时间窗口</label>
            <div class="col-sm-4">
              <input class="form-control highlight-border" min="0" ng-model='currentRule.timeWindow' placeholder="降级时间间隔, 单位秒"
                     type='number'/>
            </div>
          </div>
        </form>
      </div>
      <div class="separator"></div>
      <div clss="row" style="margin-top: 20px;">
        <button class="btn btn-outline-danger" ng-click="closeThisDialog()"
                style="float:right; height: 30px;font-size: 12px;margin-left: 10px;">取消
        </button>
        <button class="btn btn-outline-success" ng-click="saveRule()"
                style="float:right; height: 30px;font-size: 12px;margin-left: 10px;">{{degradeRuleDialog.confirmBtnText}}
        </button>
        <button class="btn btn-default" ng-click="saveRuleAndContinue()"
                ng-if="degradeRuleDialog.saveAndContinueBtnText"
                style="float:right; height: 30px;font-size: 12px;">{{degradeRuleDialog.saveAndContinueBtnText}}
        </button>
      </div>
    </div>
  </div>
</div>
